package no_git_group;

import org.openqa.selenium.By;
import org.testng.annotations.*;

import static org.junit.Assert.*;
import no_git_group.model.User;
import no_git_group.model.Film;

public class SearchMovie extends no_git_group.pages.TestBase {
	User admin = new User().setLogin("admin").setPassword("admin");
	Film noMovieFound = new Film().setTitle("Amelie").setYear("2001");
	Film movieFound = new Film().setTitle("One More Movie").setYear("2001");
	
	/*@BeforeMethod
	  public void login() {
	    if (app.getUserHelper().isNotLoggedIn()) {
	    	app.getUserHelper().loginAs(admin);
	    }
	  }*/
	  
 	  @Test
	  public void searchNoMovie() throws Exception {
		  //app.getNavigationHelper().openMainPage();
		  app.getUserHelper().loginAs(admin);
		  app.getFilmHelper().search(noMovieFound.getTitle());
		  assertTrue(app.getFilmHelper().isMovieFound());
	  }
 	  
 	  @Test
	  public void searchMovie() throws Exception {
		  //app.getNavigationHelper().openMainPage();
		  app.getFilmHelper().search(movieFound.getTitle());
		  assertFalse(app.getFilmHelper().isMovieFound());
	  }
}



